import java.text.DateFormat;
import java.time.LocalDateTime;
import java.time.chrono.ChronoLocalDate;
import java.util.Date;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

public class Leetcode1185 {
    public static void main(String[] args) {
        System.out.println(dayOfTheWeek(31, 8, 2019));
        System.out.println(dayOfTheWeek(18, 7, 1999));
        System.out.println(dayOfTheWeek(15, 8, 1993));
    }

    private static final String week[] = {"", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};

    public static String dayOfTheWeek(int day, int month, int year) {
        LocalDateTime localDateTime = LocalDateTime.of(year, month, day, 0, 0);
        return week[localDateTime.getDayOfWeek().getValue()];
    }
}
